package com.ziyun.erp.modules.order.entity;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.ziyun.erp.common.utils.UserUtils;
import io.renren.modules.sys.entity.SysUserEntity;
import org.apache.catalina.User;

import java.io.Serializable;
import java.util.Date;

/**
 * 订单erp操作日志记录
 * 
 * @author gaosheng
 * @email 
 * @date 2018-08-09 08:47:02
 */
@TableName("erp_order_log")
public class ErpOrderLogEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 自增id
	 */
	@TableId
	private Integer logId;
	/**
	 * 订单号
	 */
	private String orderNo;
	/**
	 * 对象ID
	 */
	private Long relId;
	/**
	 * 操作员ID
	 */
	private String createBy;
	/**
	 * 操作人姓名
	 */
	private String createName;
	/**
	 * 创建时间
	 */
	private Date createTime;
	/**
	 * 操作内容
	 */
	private String logText;

	public ErpOrderLogEntity() {
	}

	public ErpOrderLogEntity(String orderNo,String logText,SysUserEntity user) {
		this.orderNo = orderNo;
		if(user == null){
			this.createBy = "1";
			this.createName = "admin";
		}else{
			this.createBy = ""+user.getUserId();
			this.createName = user.getUsername();
		}
		this.logText = logText;
	}

	public ErpOrderLogEntity(String orderNo, Long relId, String logText, SysUserEntity user) {
		this.orderNo = orderNo;
		this.relId = relId;
		this.logText = logText;
		if(user == null){
			this.createBy = "1";
			this.createName = "admin";
		}else{
			this.createBy = ""+user.getUserId();
			this.createName = user.getUsername();
		}
	}

	/**
	 * 请求URI
	 */

	private String url;


	/**
	 * 设置：自增id
	 */
	public void setLogId(Integer logId) {
		this.logId = logId;
	}
	/**
	 * 获取：自增id
	 */
	public Integer getLogId() {
		return logId;
	}
	/**
	 * 设置：订单号
	 */
	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}
	/**
	 * 获取：订单号
	 */
	public String getOrderNo() {
		return orderNo;
	}
	/**
	 * 设置：对象ID
	 */
	public void setRelId(Long relId) {
		this.relId = relId;
	}
	/**
	 * 获取：对象ID
	 */
	public Long getRelId() {
		return relId;
	}
	/**
	 * 设置：操作员ID
	 */
	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}
	/**
	 * 获取：操作员ID
	 */
	public String getCreateBy() {
		return createBy;
	}
	/**
	 * 设置：操作人姓名
	 */
	public void setCreateName(String createName) {
		this.createName = createName;
	}
	/**
	 * 获取：操作人姓名
	 */
	public String getCreateName() {
		return createName;
	}
	/**
	 * 设置：创建时间
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	/**
	 * 获取：创建时间
	 */
	public Date getCreateTime() {
		return createTime;
	}
	/**
	 * 设置：操作内容
	 */
	public void setLogText(String logText) {
		this.logText = logText;
	}
	/**
	 * 获取：操作内容
	 */
	public String getLogText() {
		return logText;
	}
	/**
	 * 设置：请求URI
	 */
	public void setUrl(String url) {
		this.url = url;
	}
	/**
	 * 获取：请求URI
	 */
	public String getUrl() {
		return url;
	}
}
